#ifndef _THREADING_H
#define _THREADING_H

#include <process.h>
#include "server.h"

typedef void(*FUNC)(LPVOID);
typedef struct {
	Server *server;
	SOCKET sock;
	Address *addr;
} THREAD_DATA;
class ThreadedServer:public Server {
	public:
		ThreadedServer();
		void SetThreads(int);
		void SetHandle(FUNC);
		virtual void StartServer();
	private:
		int threads;
		FUNC handle;
		static unsigned __stdcall HandleEx(LPVOID);
};

#endif
